<?php
declare(strict_types=1);

use Phinx\Migration\AbstractMigration;

final class AddColumnIsSecondConfirmInReviewRequestNodeTable extends AbstractMigration
{
    public function up()
    {
        $this->table('review_request_node')
            ->addColumn('feedback_status', 'enum', ['values' => 'waiting_confirm,accept_feedback,reject_feedback', 'default' => 'waiting_confirm', 'null' => false, 'comment' => '反馈状态(waiting_confirm 等待处理,accept_feedback接受反馈,reject_feedback拒绝反馈)'])
            ->addColumn('is_second_confirm', 'enum', ['values' => 'yes,no', 'default' => 'no', 'null' => false, 'comment' => '是否二次确认通过'])
            ->save();
    }

    public function down()
    {
        $this->table('review_request_node')
            ->removeColumn('feedback_status')
            ->addColumn('is_second_confirm')
            ->save();
    }
}
